public class Queue {
	private QueueElement ground = null;

	public void push(StringNode path) {
		if(ground==null) {
			this.ground=new QueueElement(path, null);		
		} else {
			ground = new QueueElement(path, ground);
		}
	}
	
	public StringNode pop(){
		if(ground!=null) {
			QueueElement tempqueueelement = ground;
			ground = ground.getPrev();
			return tempqueueelement.getNode();
		} else {
			return null;
		}
	}
}
